package com.agricultureaigclargemodel.history.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.agricultureaigclargemodel.history.mapper.ChatHistoryMapper;
import com.agricultureaigclargemodel.history.domain.ChatHistory;
import com.agricultureaigclargemodel.history.service.IChatHistoryService;

/**
 * 聊天历史记录Service业务层处理
 * 
 * @author Evanescent
 * @date 2025-06-05
 */
@Service
public class ChatHistoryServiceImpl implements IChatHistoryService 
{
    @Autowired
    private ChatHistoryMapper chatHistoryMapper;

    /**
     * 查询聊天历史记录
     * 
     * @param chatId 聊天历史记录主键
     * @return 聊天历史记录
     */
    @Override
    public ChatHistory selectChatHistoryByChatId(String chatId)
    {
        return chatHistoryMapper.selectChatHistoryByChatId(chatId);
    }

    /**
     * 查询聊天历史记录列表
     * 
     * @param chatHistory 聊天历史记录
     * @return 聊天历史记录
     */
    @Override
    public List<ChatHistory> selectChatHistoryList(ChatHistory chatHistory)
    {
        return chatHistoryMapper.selectChatHistoryList(chatHistory);
    }

    /**
     * 新增聊天历史记录
     * 
     * @param chatHistory 聊天历史记录
     * @return 结果
     */
    @Override
    public int insertChatHistory(ChatHistory chatHistory)
    {
        return chatHistoryMapper.insertChatHistory(chatHistory);
    }

    /**
     * 修改聊天历史记录
     * 
     * @param chatHistory 聊天历史记录
     * @return 结果
     */
    @Override
    public int updateChatHistory(ChatHistory chatHistory)
    {
        return chatHistoryMapper.updateChatHistory(chatHistory);
    }

    /**
     * 批量删除聊天历史记录
     * 
     * @param chatIds 需要删除的聊天历史记录主键
     * @return 结果
     */
    @Override
    public int deleteChatHistoryByChatIds(String[] chatIds)
    {
        return chatHistoryMapper.deleteChatHistoryByChatIds(chatIds);
    }

    /**
     * 删除聊天历史记录信息
     * 
     * @param chatId 聊天历史记录主键
     * @return 结果
     */
    @Override
    public int deleteChatHistoryByChatId(String chatId)
    {
        return chatHistoryMapper.deleteChatHistoryByChatId(chatId);
    }
}
